import 'package:flutter/material.dart';
import 'package:get/get.dart';

import '../../bridge/bridge.dart';
import '../../reouter.dart';
import '../../router/app_route_container.dart';
import 'setting_logic.dart';

class SettingPage extends StatelessWidget {
  SettingPage({Key? key}) : super(key: key);

  final logic = Get.find<SettingLogic>();
  final state = Get.find<SettingLogic>().state;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: const Text("SettingPage"),
      ),
      body: Container(
        margin: const EdgeInsets.all(15),
        child: Column(
          children: [
            GestureDetector(
              onTap: () {
                FlutterBridge.getInstance().flutterToAndroid({'event': "item1", 'content': "item1"});
              },
              child: const Text(
                "item1",
                style: TextStyle(fontSize: 16),
              ),
            ),
            const SizedBox(
              height: 20,
            ),
            GestureDetector(
              onTap: () {
                FlutterBridge.getInstance().flutterToAndroid({'event': "item2", 'content': "item2"});
              },
              child: const Text(
                "item2",
                style: TextStyle(fontSize: 16),
              ),
            ),
            const SizedBox(
              height: 20,
            ),
            GestureDetector(
              onTap: () {
                AppRouteContainer.share.openPage(context, "/home");
              },
              child: const Text(
                "item3",
                style: TextStyle(fontSize: 16),
              ),
            ),
            const SizedBox(
              height: 10,
            ),
          ],
        ),
      ),
    );
  }
}
